<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%@include file="menu.jsp"%>
<jsp:useBean id="db" class="com.zipishu.DataBaseConnection">
</jsp:useBean>
<!-- Page Head -->
			<div class="content-box"><!-- Start Content Box -->				
				<div class="content-box-header">
					
					<h3>类别管理</h3>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					<div class="notification information png_bg">
							<a href="#" class="close"><img src="./images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
							<div>
								随便提醒点什么, 注意事项.
							</div>
					</div>
					<!-- Data Table -->
					<table>							
							<thead>
								<tr>
								   <th><input class="check-all" type="checkbox" /></th>
								   <th>类别名称</th>
								   <th>分类</th>
								   <th>简介</th>
								   <th>发表时间</th>
								   <th>点击</th>
								   <th>操作</th>
								</tr>								
							</thead>						 
							<tfoot>
								<tr>
									<td colspan="8">
										<div class="bulk-actions align-left">
											<select name="dropdown">
												<option value="option1">请选择操作...</option>
												<option value="option2">编辑</option>
												<option value="option3">删除</option>
											</select>
											<a class="button" href="#">选中的项</a>
										</div>
										
										<div class="pagination">
											<a href="#" title="首页">&laquo; 首页</a><a href="#" title="前一页">&laquo; 前一页</a>
											<a href="#" class="number" title="1">1</a>
											<a href="#" class="number" title="2">2</a>
											<a href="#" class="number current" title="3">3</a>
											<a href="#" class="number" title="4">4</a>
											<a href="#" title="后一页">后一页 &raquo;</a><a href="#" title="末页">末页 &raquo;</a>
										</div> <!-- End .pagination -->
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>						 
							<tbody>
	<%
	Connection dbc = db.getConnection();
	Statement stmt = dbc.createStatement();
	String sql = "SELECT c.catalogid,c.catalogname,cl.classname,c.about,c.createdate,c.hit FROM catelog AS c,class as cl WHERE c.classid=cl.classid";
	ResultSet rs = stmt.executeQuery(sql);
	while(rs.next()){
	%>

		<tr>
			<td><input type="checkbox" /></td>
			<td><%=rs.getString("catalogname")%></td>
			<td><%=rs.getString("classname")%></td>
			<td><%=rs.getString("about")%></td>
			<td><%=rs.getDate("createdate")%></td>
			<td><%=rs.getInt("hit")%></td>
			<td>
				<!-- Icons -->
				 <a href="itemManage.jsp?catalogid=<%=rs.getInt("catalogid")%>" title="Edit"><img src="./images/icons/pencil.png" alt="Edit" /></a>
				 <a href="itemManage_action.jsp?action=delete&catalogid=<%=rs.getInt("catalogid")%>" title="Delete"><img src="./images/icons/cross.png" alt="Delete" /></a> 
			</td>
		</tr>		
		<br/>
	<%
	}
	rs.close();
	dbc.close();
	%>
							</tbody>
							
						</table>
	     </div>
  </div>

		<script type="text/javascript">
			
			$(document).ready(function(){
				
				/*如果是没有子菜单的选中，如下
				$('#admin-index').addClass('current');*/
				
				/*如果含有子菜单的，请选中父菜单和子菜单，如下*/
				$('#admin-class').addClass('current');
				$('#admin-class').parent().find("ul").slideToggle("slow");
				$('#admin-class-manage').addClass('current');
				
			});
		</script>



<%@include file="footer.jsp"%>